import os
import time
import fmt

fn main() {
    fmt.printf('hello %v, nice: %v, %%, float: %v\n', 'world', 12, 3.1415, 233)

    var s = fmt.sprintf('err msg=%v, count=%v', 'this is failed', 253)
    println(s, 'len=', s.len())

    string time_str = time.now().datetime()
    var actual = fmt.sprintf('err msg=%v, %v, count=%v\n', 'time in', time_str, 253)
    var except = 'err msg=time in, '+ time_str +', count=253\n'
    assert(actual == except)

    fmt.printf('%0d\n', -12)
    fmt.printf('%0d\n', 12)

    fmt.printf('|%5d|\n', -12)
    fmt.printf('|%5d|\n', 12)

    fmt.printf('|%010d|\n', -12)
    fmt.printf('|%010d|\n', 12)
}